package hottargui.config;

import hottargui.framework.PlayerColor;
import hottargui.framework.TurnSequenceStrategy;
import java.util.*;

public class AlphaTurnSequenceStrategy implements TurnSequenceStrategy {

    List<PlayerColor> turnSequence;
    int next;
    
    public AlphaTurnSequenceStrategy() {
	turnSequence = new ArrayList<PlayerColor>();
	// 4 players
	turnSequence.add(PlayerColor.Red);
	turnSequence.add(PlayerColor.Green);
	turnSequence.add(PlayerColor.Blue);
	turnSequence.add(PlayerColor.Yellow);
	next = 0;
    }
    public PlayerColor getNextPlayer() {
	// TODO Auto-generated method stub
	try {
	  return turnSequence.get(next++);
	}
	catch (IndexOutOfBoundsException e) {
	    next = 0;
	    return PlayerColor.None;
	}
    }
}
